<template>
  <div class="my-normal-block-bg">
    <div class="block-title-bg">
      <div class="block-title">分单规则号: {{blockData.ruleNo}}</div>
      <div class="block-icon">
        <span><i class="el-icon-edit"></i>编辑</span>
        <span><i class="el-icon-delete"></i>删除</span>
      </div>
    </div>
    <div class="block-content">
      <div class="block-address">
        <div>行政区域：{{blockData.address}}</div>
        <div>分单区域：{{blockData.place}}</div>
      </div>
      <div class="customer-info-list-bg">
        <div class="customer-info-title">续收专员：</div>
        <div class="customer-info-list">
          <div class="customer-info-bg">
            <div v-for="(item, index) in blockData.commissionerList" :key="index" class="customer-info">
              <div class="customer-info-img">
                <img src="https://img0.baidu.com/it/u=3140672467,1439288444&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500" alt="">
              </div>
              <div class="customer-info-content">
                <div class="customer-info-content-text">{{item.name}}</div>
                <div class="customer-info-content-text">分单比例：{{item.percent}}</div>
                <div class="customer-info-content-text">工作量阑值：{{item.threshold}}</div>
              </div>
            </div>
          </div>
          <div class="customer-icon-bg">
            <div class="customer-icon">
              <i class="el-icon-arrow-right"></i>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div v-if="blockData.state == '2'" class="block-state">
      <div class="block-state-bg"></div>
      <div class="block-state-text">无效</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'NormalBlock',
  props: {
    blockData: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {}
  },
  methods: {},
}
</script>

<style lang="scss" scoped>
.my-normal-block-bg{
  width: 100%;
  min-width: 600px;
  background-color: #fff;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  position: relative;
  .block-title-bg{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #0090DA;
    color: #fff;
    .block-title{}
    .block-icon{
      span{
        margin-left: 20px;
        cursor: pointer;
      }
    }
  }
  .block-content{
    padding: 16px;
    .block-address{
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
      font-weight: bold;
    }
    .customer-info-list-bg{
      .customer-info-title{
        margin-bottom: 10px;
      }
      .customer-info-list{
        display: flex;
        align-items: center;
        justify-content: space-between;
        .customer-info-bg{
          width: 500px;
          display: flex;
          align-items: center;
          .customer-info{
            width: 280px;
            position: relative;
            padding-right: 20px;
            .customer-info-img{
              position: absolute;
              top: 30px;
              left: 0;
              img{
                width: 40px;
                height: 40px;
                border-radius: 50%;
              }
            }
            .customer-info-content{
              width: 210px;
              background-color: #fff;
              box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
              padding: 10px 10px 10px 30px;
              margin-left: 20px;
              .customer-info-content-text{
                padding: 6px 0;
              }
            }
          }
        }
        .customer-icon-bg{
          width: 40px;
          font-size: 22px;
          font-weight: bold;
          .customer-icon{
            width: 30px;
            line-height: 30px;
            text-align: center;
            background-color: #8cd9ffb3;
            border-radius: 50%;
            color: #fff;
            cursor: pointer;
          }
        }
      }
    }
  }
  .block-state{
    position: absolute;
    top: 2px;
    left: -17px;
    .block-state-bg{
      width: 74px;
      height: 0;
      border-bottom: 24px solid orange;
      border-left: 22px solid transparent;
      border-right: 28px solid transparent;
      transform: rotate(-40deg);
    }
    .block-state-text{
      position: absolute;
      color: white;
      top: 6px;
      left: 20px;
      transform: rotate(-40deg);
    }
  }
}
</style>
